<template>
  <div>
  
  <el-form ref="form" :model="form" label-width="80px">
  <el-form-item label="名称">
    <el-input v-model="form.name"></el-input>
  </el-form-item>
    <el-form-item label="类型">
    <el-radio-group v-model="form.resource" @change="change">
      <el-radio label="角色" value=1></el-radio>
      <el-radio label="继承角色" value=2></el-radio>
    </el-radio-group>
  </el-form-item>
  <div v-show='flag'>
    <el-form-item label="活动区域">
    <el-select v-model="form.region" placeholder="请选择活动区域">
      <el-option label="区域一" value="shanghai"></el-option>
      <el-option label="区域二" value="beijing"></el-option>
    </el-select>
  </el-form-item>
  </div>

  

  
  <el-form-item>
    <el-button type="primary" @click="onSubmit">立即创建</el-button>
    <el-button>取消</el-button>
  </el-form-item>
</el-form>

  </div>
</template>

<script>
  export default {
    data() {
      return {
        flag:true,
        form: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '角色',
          desc: '',
          
        }
      }
    },
    methods: {
      onSubmit() {
        console.log('submit!');
        this.axios.get("http://127.0.0.1:8010/api/mall/v1/admin/auth/getrolelist?page=1&page_size=2").then(res=>{
          console.log(res)
        })
      },
      change(v){
        if(v == "继承角色"){
          this.flag=false
        }else{
          this.flag=true
        }
      }
    }
  }
</script>

<style>

</style>